const path = require("path");
const { merge } = require("webpack-merge");
const common = require("./webpack.common.js");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const appConfig = require("../app.config.js");

module.exports = merge(common, {
  mode: "development",
  devtool: "inline-source-map",
  devServer: {
    open: true, // 编译完自动打开浏览器
    port: appConfig.SVG_PORT,
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: path.resolve(__dirname, "../src/assets/icons/index.html"), // 使用自定义模板
    }),
  ],
  entry: {
    index: path.resolve(__dirname, "../src/assets/icons/index.ts"),
  },
  output: {
    // publicPath: "/",
  },
});
